﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ERP.Inventory.Infastructure.Interface
{
    public interface IBaseRepository<T>
    {
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="t">实体类</param>
        /// <returns>返回受影响的行数</returns>
        Task<int> Add(T t);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="t">实体类</param>
        /// <returns>返回受影响的行数</returns>
        Task<int> Update(T t);
        /// <summary>
        /// 查询全部
        /// </summary>
        /// <returns>返回受影响的行数</returns>
        IQueryable<T> GetAll();
        /// <summary>
        /// 查询单个
        /// </summary>
        /// <param name="id">id</param>
        /// <returns>返回受影响的行数</returns>
        Task<T> GetValue(int id);
        Task<int> AddRange(List<T> list);
    }
}
